<template>
	<view class="carEmpty">
		<view class="carEmpty-name flex-c-c">购物车</view>
		<view class="carEmpty-img">
			<image class="carEmpty-icon" src="/static/image/carEmpty.png"></image>
		</view>
		<view class="car-text">
			<view class="carEmpty-text1">购物车竟然是空的</view>
			<view class="carEmpty-text2">再忙也要记得买点什么犒劳自己~</view>
		</view>
		<view class="carEmpty-goHome-Btn">
		<button class="goHome-Btn" @click="goIndexPage">去首页逛逛~</button>
		</view>
	</view>
</template>

<script setup>
	// 去往首页页面
	const goIndexPage = () => {
		uni.switchTab({
			url: '/pages/index/index'
		});
		console.log('2222222')
	}
</script>

<style lang="scss">
	// 页面设置
	page {
		background-color: #f4f4f4;
	}
	// 购物车页面
	.carEmpty {
		display: flex;
		flex-direction: column;
		// 标题名字
		.carEmpty-name {
			text-align: center;
			background-color: white;
			font-size: px2rpx(16);
			width: px2rpx(375);
			height: px2rpx(45);
		}
		// 空的购物车图片
		.carEmpty-img {
			display: flex;
			justify-content: center;
			margin-top: px2rpx(20);
			.carEmpty-icon {
				margin: px2rpx(10) 0;
				width: px2rpx(110);
				height: px2rpx(110);
			}
		}
		// 购物车的文本备注
		.car-text {
			width: 100vw;
			display: flex;
			flex-direction: column;
			align-items: center;
			.carEmpty-text1 {
				font-size: px2rpx(18);
				margin: px2rpx(10) 0;
				width: px2rpx(145);
				height: px2rpx(18);
				color: #666;
			}
			.carEmpty-text2 {
				color: #999;
				font-size: px2rpx(13);
				width: px2rpx(202);
				height: px2rpx(16);
			}
		}
		// 触发去往首页的按钮
		.carEmpty-goHome-Btn {
			display: flex;
			align-items: center;
			justify-content: center;
			width: 100vw;
			.goHome-Btn {
				background: linear-gradient(to right, #ff0000, #fff07d);
				color: rgba(248, 248, 248, 0.9);
				font-size: px2rpx(14);
				border: #ffffff solid px2rpx(0.6);
				height: px2rpx(39);
				margin: px2rpx(29) 0;
				padding: 0 px2rpx(15);
			}
		}
	}
</style>